package com.zlx.redismessage.conf;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

/**
 * 加载系统配置信息
 */
@Configuration
public class SystemCfg {

    /**
     * 消费者数量, 默认5个
     */
    public static int consumerNum;

    /**
     * 消息推送间隔,默认值: 10秒/次
     */
    public static long interval;

    /**
     * 队列大小, 默认长度: 10000
     */
    public static int queueSize;

    /**
     * 文件检测地址
     */
    public static String fileCheckUrl;

    @Value("${fileCheck.url:}")
    public void getFileCheckUrl(String fileCheckUrl){
        SystemCfg.fileCheckUrl = fileCheckUrl;
    }

    @Value("${redisQueue.detection.consumerNum:5}")
    public void setConsumerNum(int consumerNum) {
        SystemCfg.consumerNum = consumerNum;
    }

    @Value("${redisQueue.detection.interval:10000}")
    public void setInterval(long interval) {
        SystemCfg.interval = interval;
    }

    @Value("${redisQueue.detection.queueSize:1000}")
    public void setQueueSize(int queueSize) {
        SystemCfg.queueSize = queueSize;
    }
}
